Skip to main content

interval

Return a string with format: 10h15m

Basic Usage#

const maskWizard = require("mask-wizard")
// [...]
function applyTimeMask(e) {
// the time() output in some value cases
// 1 OUTPUT 00h01m
// 10 OUTPUT 00h10m
// 101 OUTPUT 01h01m
// 1015 OUTPUT 10h15m
e.currentTarget.value = maskWizard.time.interval(e.currentTarget.value)
}
<input placeholder="Example" onChange={applyTimeMask} />

Alert

That mask not allow backspace yet (feel free to open a pr if you want this fixed)

Parameters#

Parameter Nametyperequireddefaultdescription
timeInputstringyesnullstring to be masked
maxLengthnumbernonullmaxLenght for return

Live Example#